﻿using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;

namespace PlanningGIS.Framework
{
    /// <summary>
    /// 停靠窗体管理类
    /// </summary>
    public interface IDockManager
    {
        /// <summary>
        /// 面板容器管理对象
        /// </summary>
        object DockManager { set; }

        /// <summary>
        /// 主窗体
        /// </summary>
        Form MainForm { set; }

        /// <summary>
        /// 激活停驻面板，使该面板处于最前
        /// </summary>
        /// <param name="name">面板名称</param>
        /// <param name="text">面板标题</param>
        void ActivateDockPanel(string name, string text = "");

        /// <summary>
        /// 激活停驻面板，使该面板处于最前
        /// </summary>
        /// <param name="name">面板名称</param>
        void UnActivateDockPanel(string name);

        /// <summary>
        /// 判断停靠窗体是否已激活
        /// </summary>
        /// <param name="name"></param>
        bool DockPanelActivated(string name);

        /// <summary>
        /// 移除停驻面板
        /// </summary>
        /// <param name="name">面板名称</param>
        void RemoveDockPanel(string name);

        /// <summary>
        /// 获取指定停驻面板中的控件
        /// </summary>
        /// <param name="name">面板名称</param>
        /// <returns>停驻面板中的控件</returns>
        Control GetControlFromDockPanel(string name);

        /// <summary>
        /// 增加停驻面板
        /// </summary>
        /// <param name="text">面板名称</param>
        /// <param name="control">面板中的控件</param>
        /// <param name="isReplace">是否替换同名面板</param>
        /// <param name="sides">位置</param>
        /// <returns>是否添加成功</returns>
        [Obsolete("已废弃")]
        bool AddDockPanel(string text, Control control, bool isReplace, esriDockFlags sides);

        /// <summary>
        /// 添加停靠面板
        /// </summary>
        /// <param name="name">面板名称，不能为空</param>
        /// <param name="text">停靠窗口名称</param>
        /// <param name="control">停靠窗口中的控件</param>
        /// <param name="isReplace">是否替换控件</param>
        /// <param name="sides">停靠位置</param>
        bool AddDockPanel(string name, Control control, esriDockFlags sides, string text = "", bool isReplace = true);

        /// <summary>
        /// 添加主容器面板页签
        /// </summary>
        /// <param name="name">页签名称</param>
        /// <param name="control">面板中的控件</param>
        /// <param name="text">页签标题</param>
        /// <returns></returns>
        bool AddTabItem(string name, Control control, string text = "");

        /// <summary>
        /// 激活停驻面板，使该面板处于最前
        /// </summary>
        /// <param name="name">面板名称</param>
        void ActivateTabItem(string name);
    }
}

